package br.org.ifrr.controller;

import java.io.Serializable;
import java.util.List;

import javax.faces.bean.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;

import br.org.ifrr.model.Gestor;
import br.org.ifrr.repository.Gestores;
import br.org.ifrr.repository.filter.GestorFilter;

@Named
@ViewScoped
public class PesquisaGestorBean implements Serializable {

	private static final long serialVersionUID = 1L;

	@Inject
	private Gestores gestores;

	private Gestor gestor;

	private GestorFilter filtro;

	private List<Gestor> gestorFiltrados;

	private Gestor gestorSelecionado;

	public PesquisaGestorBean() {
		filtro = new GestorFilter();
	}

	public void pesquisar() {
		gestorFiltrados = gestores.filtrados(filtro);
	}

	public Gestor getGestor() {
		return gestor;
	}

	public void setGestor(Gestor gestor) {
		this.gestor = gestor;
	}

	public Gestor getGestorSelecionado() {
		return gestorSelecionado;
	}

	public void setGestorSelecionado(Gestor gestorSelecionado) {
		this.gestorSelecionado = gestorSelecionado;
	}

	public GestorFilter getFiltro() {
		return filtro;
	}

	public List<Gestor> getGestorFiltrados() {
		return gestorFiltrados;
	}

}
